package com.supermap.business.cloud.key;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtils;
import com.supermap.dubbo.api.cloud.key.KeyWordService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


/**
 * @author aqua
 * @desc
 * @date 2019年07月23 16:46
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/key")
public class KeyWordController {

    @Reference(timeout = 100000)
    private KeyWordService keyWordService;

    //查询列表
    @GetMapping("/getSysKeyWordList")
    @ResponseBody
    public JSONUtils getSysKeyWordList(String areaCode, String typeCode, Integer state){
        return keyWordService.getSysKeyWordList(areaCode,typeCode,state);
    }

    //删除
    @DeleteMapping("/delKeyWord")
    @ResponseBody
    public JSONUtils delKeyWord(Integer id){
        return keyWordService.delKeyWord(id);
    }

    //审核
    @PostMapping("/upState")
    @ResponseBody
    public JSONUtils upState(Integer keyId,String typeCode,Integer typeId,Integer state,String autoContent,String auditorId){
        if(state==1){
            keyWordService.upKeyWord(typeCode,typeId,0);
        }
        return keyWordService.upState(keyId,state,autoContent,auditorId);
    }



}
